<html>
<head>
    <title>跨域测试</title>
    <meta charset="UTF-8">
    <script src="/js/jquery.js"></script>
    <script>
        //回调函数
        function showData (result) {
            var data = JSON.stringify(result); //json对象转成字符串
            $("#text").val(data);
        }

        $(document).ready(function () {

            $("#btn").click(function () {
                //向头部输入一个脚本，该脚本发起一个跨域请求
                $("head").append("<script src='http://127.0.0.1:8092/user/JsonUserNo?userNo=dsad&pwd=123456789&jsoncallback=showData'><\/script>");
            });

        });
    </script>
</head>
<body>
<input id="btn" type="button" value="跨域获取数据" />
<textarea id="text" style="width: 400px; height: 100px;"></textarea>

</body>
</html>